<?php
//require_once  __DIR__ . '/includes/authenticate.php';

if (isset($_POST['team']) && isset($_POST['text']) && isset($_POST['season'])) {
	
	include_once './db_bb_connect.php';

	$team = $_POST['team'];
	$text = $_POST['text'];
	$season = $_POST['season'];

	$sql = "UPDATE opponents SET text = '$text'
	WHERE (season = '$season' AND teamname = '$team')";

	if ($db->query($sql)){
		echo "<br><center> Data of $team succesfully added! </center>";
	} else {
		echo "Something went wrong, data not added";
		echo "Error: " . $sql . "<br>" . $db->error;
	};


}



?>